package com.example.service.impl;

import com.example.common.Page;
import com.example.common.PageQueryParam;
import com.example.dao.TSongMapper;
import com.example.entity.TSongEntity;
import com.example.service.TSongService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service("tSongService")
public class TSongServiceImpl implements TSongService {

    @Autowired
    TSongMapper tSongMapper;

    @Override
    public Page<TSongEntity> query(PageQueryParam<TSongEntity> pageQueryParam) {
        List<TSongEntity> rows = tSongMapper.query(pageQueryParam);
        long total = tSongMapper.queryCount(pageQueryParam);
        Page<TSongEntity> page = new Page<>();
        page.setRows(rows);
        page.setTotal(total);
        return page;
    }
}